package com.example.pojo;

import lombok.ToString;

import java.util.List;
import java.util.Map;

/**
 * @author yexi
 */
@ToString
public class CommonClass {
    private String name;
    private Map<String, Integer> records;
    private List<String> list;
    private Map<String, String> gmailMap;
    private OtherClass otherClass;

    public CommonClass(OtherClass otherClass) {
        System.out.println("CommonClass的带参构造器CommonClass(OtherClass)被调用: " + this);
        this.otherClass = otherClass;
    }

    public CommonClass() {
        //在配置文件配置好之后。当Spring容器启动时，就会为对应的类创建bean，因此该方法会被调用输出。
        System.out.println("CommonClass的无参构造器被调用: " + this);
    }

    public void setOtherClass(OtherClass otherClass) {
        System.out.println("CommonClass的setOtherClass方法被成功调用，设置值为: " + otherClass);
        this.otherClass = otherClass;
    }

    public void setName(String name) {
        System.out.println("CommonClass的setName方法被成功调用，设置值为: " + name);
        this.name = name;
    }

    public void setRecords(Map<String, Integer> records) {
        System.out.println("CommonClass的setRecords方法被成功调用，设置值为: " + records);
        this.records = records;
    }

    public void setList(List<String> list) {
        System.out.println("CommonClass的setList方法被成功调用，设置值为: " + list);
        this.list = list;
    }

    public void setGmailMap(Map<String, String> gmailMap) {
        System.out.println("CommonClass的setGmailMap方法被成功调用，设置值为: " + gmailMap);
        this.gmailMap = gmailMap;
    }

}
